package com.enation.app.shop.front.policyInsurance.service.impl;

import com.enation.app.shop.front.policyInsurance.entity.HarmLessConduct;
import com.enation.app.shop.front.policyInsurance.service.HarmLessConductMapper;
import com.enation.framework.database.IDaoSupport;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("harmlessconductservice")
public class HarmLessConductService implements HarmLessConductMapper{
    @Autowired
    private IDaoSupport daoSupport;
    @Override
    public int deleteByPrimaryKey(Long id) {
        return 0;
    }

    @Override
    public int insert(HarmLessConduct record) {
        this.daoSupport.insert("rbt_harmless_conduct",record);
        return 1;
    }

    @Override
    public int insertSelective(HarmLessConduct record) {
        return 0;
    }

    @Override
    public HarmLessConduct selectByPrimaryKey(Long id) {
        return null;
    }

    @Override
    public int updateByPrimaryKeySelective(HarmLessConduct record) {
        return 0;
    }

    @Override
    public int updateByPrimaryKey(HarmLessConduct record) {
        return 0;
    }

    @Override
    public List<HarmLessConduct> getByClaimid(long l) {
        String sql="select * from   rbt_harmless_conduct where claims_settlement_id=?";
        return this.daoSupport.queryForList(sql,HarmLessConduct.class,l);
    }

    @Override
    public void deleteByClaimid(Long claimid) {
        String sql="delete from  rbt_harmless_conduct where claims_settlement_id=?";
        this.daoSupport.execute(sql,claimid);
    }
}
